package com.android.tianyuanyouxuan.ui.activity;

import android.os.Bundle;
import android.view.LayoutInflater;

import androidx.annotation.Nullable;

import com.android.tianyuanyouxuan.App;
import com.android.tianyuanyouxuan.base.BaseActivity;
import com.android.tianyuanyouxuan.bean.News;
import com.android.tianyuanyouxuan.databinding.ActivityNewsDetailsBinding;
import com.android.tianyuanyouxuan.util.NewsUtil;

public class NewsDetailsActivity extends BaseActivity {

    private ActivityNewsDetailsBinding viewBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewBinding = ActivityNewsDetailsBinding.inflate(LayoutInflater.from(this));
        setContentView(viewBinding.getRoot());
        initTitleBar();
        News news = App.mApp.getDaoSession().getNewsDao().load(getIntent().getLongExtra("data", 0));
        viewBinding.webView.loadData(NewsUtil.getMoban(news), "text/html; charset=UTF-8",null);

    }


}

